﻿using System;
using System.Linq;
using System.Collections.Generic;
using System.Text;

namespace Scan.Model
{
    public class ReturnMessage : ErrorMessage
    {
        public enum RetCode
        {
            UNKNOWN = -1,
            SUCCESS = 0,
            SQLCE_EXCEPTION,
            SQLCE_PARAMERROR,
            INVALID_VALUE,
            OUT_OF_MEMOERY,
            NOTALLOWNULL_EXCEPTION,
            FORMATION_EXCEPTION,
            SOAP_EXCEPTION,
            COMMUNICATION_EXCEPTION,
            NOENTRY_ERROR,
            SERVER_ERROR,
            SERVER_NORESPONE,
            SERVER_REFUSE,
            TIMEOUT_EXCEPTION
        }

        private RetCode _retcode;
        /// <summary>
        /// 返回值编码
        /// </summary>
        public RetCode ReturnCode
        {
            get { return _retcode; }
            set { _retcode = value; }
        }

        public ReturnMessage()
        {
            this._retcode = RetCode.SUCCESS;
        }

        public ReturnMessage(int errcode, string errormsg,RetCode retcode)
            : base(errcode, errormsg)
        {
            this._retcode = retcode;
        }

        public ReturnMessage(int errcode, string errormsg, string stacktrace, string source, RetCode retcode)
            : base(errcode, errormsg, stacktrace, source)
        {
            this._retcode = retcode;
        }
    }
}
